<script setup>
import useHomeStore from '@/stores/modules/home'
import { storeToRefs } from 'pinia'

const homeStore = useHomeStore()
const { categories } = storeToRefs(homeStore)
</script>

<template>
  <div class="home-categories">
    <template v-for="(item, index) in categories" :key="item.id">
      <div class="categories-item">
        <img :src="item.pictureUrl" alt="" />
        <p>{{ item.title }}</p>
      </div>
    </template>
  </div>
</template>

<style lang="less" scoped>
.home-categories {
  padding: 0 15px;
  display: flex;
  overflow-x: auto;
  font-size: 12px;
  scrollbar-width: none; /* firefox */
  -ms-overflow-style: none; /* IE 10+ */

  &::-webkit-scrollbar {
    display: none;
  }
  .categories-item {
    margin-top: 8px;
    flex-shrink: 0;
    width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    img {
      margin-bottom: 8px;
      width: 32px;
      height: 32px;
    }
  }
}
</style>
